import 'package:flutter/material.dart';

class WrapLayoutRoute extends StatelessWidget {
  List<Widget> makeImages() {
    var myList = List<Widget>();
    for (var i = 0; i < 50; i++) {
      myList.add(Image.asset('lib/devpics/a.jpg'));
    }
    return myList;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          leading: IconButton(
            icon: Icon(Icons.arrow_back),
            color: Colors.white,
            onPressed: () {
              Navigator.pop(context);
            },
          ),
          title: Text('warpLayout'),
        ),
        body: Wrap(
          // main axis(horizontal)
          spacing: 23.0,

          //vertical spacing
          runSpacing: 15.0,
          direction: Axis.horizontal,
          //main axis alignment
          alignment: WrapAlignment.center,
          children: <Widget>[
            Chip(
              avatar: CircleAvatar(
                backgroundColor: Colors.blue,
                child: Text('A'),
              ),
              label: Text('Hamilton'),
            ),
            Chip(
              avatar: CircleAvatar(
                backgroundColor: Colors.blue,
                child: Text('B'),
              ),
              label: Text('KFC'),
            ),
            Chip(
              avatar: CircleAvatar(
                backgroundColor: Colors.blue,
                child: Text('M'),
              ),
              label: Text('Lafayete'),
            ),
            Chip(
              avatar: CircleAvatar(
                backgroundColor: Colors.blue,
                child: Text('S'),
              ),
              label: Text('Mulligan'),
            ),
            Chip(
              avatar: CircleAvatar(
                backgroundColor: Colors.blue,
                child: Text('N'),
              ),
              label: Text('JINHAO'),
            ),
          ],
        ),
      ),
    );
  }
}
